<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateChatGroupFaqTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('chat_group_faq', function (Blueprint $table) {
            $table->id();
            $table->string('desc', 36)->default('')->comment('问题描述');
            $table->unsignedInteger('pid')->default(0)->comment('pid');
            $table->unsignedTinyInteger('level')->default(0)->comment('分级');
            $table->unsignedInteger('sort')->default(0)->comment('排序');
            $table->text('answer')->nullable(true)->default('')->comment('答案');
            $table->json('attachment')->nullable(true)->default('')->comment('附件');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '常见问题及答案';
        });
    }

    /**2
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('chat_group_faq');
    }
}
